/*
 * @Descripttion: 
 * @version: v1.0
 * @Author: 薛玉峰
 * @Date: 2020-07-01 14:41:21
 * @LastEditors: 薛玉峰
 * @LastEditTime: 2020-07-02 09:15:08
 */ 


 
 
/* (async () => {
    const link = {
        linkArr: [
            {
                name:'1page', 
                href :'https://www.baidu.com/s?wd=%22%E9%9B%B7%E5%86%9B%20%E9%A9%AC%E5%8C%96%E8%85%BE%20%E9%A9%AC%E4%BA%91%22&rsv_spt=1&rsv_iqid=0xf5c610f80002aa0c&issp=1&f=8&rsv_bp=1&rsv_idx=2&ie=utf-8&tn=baiduhome_pg&rsv_enter=0&rsv_dl=tb&rsv_sug3=35&rsv_sug1=35&rsv_sug7=101&rsv_btype=i&inputT=22088&rsv_sug4=24086'
            },
            {
                name:'2page',
                href:'https://www.baidu.com/s?wd=%22%E9%9B%B7%E5%86%9B%20%E9%A9%AC%E5%8C%96%E8%85%BE%20%E9%A9%AC%E4%BA%91%22&pn=10&oq=%22%E9%9B%B7%E5%86%9B%20%E9%A9%AC%E5%8C%96%E8%85%BE%20%E9%A9%AC%E4%BA%91%22&tn=baiduhome_pg&ie=utf-8&usm=2&rsv_idx=2&rsv_pq=c36953c400011d2f&rsv_t=bb2d4jrThQuUqsx%2FnM02k3UIW7UWS7TQ8jeAqO58Yyhfpr%2F5JYs2HI1MISQgXLSpoPJH'
            }
        ]
    }
  const browser = await puppeteer.launch({
    executablePath:'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe',
    // headless:false,
    defaultViewport :{width:1920,height:1080}});
 
  const linkArr = link.linkArr
  let i = 0
  async function forGet() {
    let  x = linkArr[i]
    const page = await browser.newPage();
    await page.goto(x.href);
    await setTimeout(x => {}, 5000)
    await page.screenshot({path: x.name+'.jpg'});
    i++
    if (i < linkArr.length) {
      forGet()
    } else {
      await browser.close();
    }
  }
 
  forGet()
})(); */
// 
